import org.apache.commons.codec.binary.Hex;
import org.junit.Test;

/**
 * HBASE中文转换
 * */
public class CHCode {
//    @Test
    public void testCode() throws Exception {
        String str = "烦烦烦";
        char[] chars = Hex.encodeHex(str.getBytes("UTF-8"));
        System.out.println(chars);

        String str2 = "\\xE7\\x83\\xA6\\xE7\\x83\\xA6\\xE7\\x83\\xA6";
//        String[] strs = str2.split("x");
//        System.out.println(strs);
//        E4B8ADE69687E8849AE69CAC

        System.out.println(new String(Hex.decodeHex("e783a6e783a6e783a6".toCharArray()), "UTF-8"));
//        System.out.println(new String(Hex.decodeHex(chars), "UTF-8"));


//E783A6E783A6E783A6
    }
}
